<!doctype html>
<html lang="`en`">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

<div id="app">
    <h3>单个复选框</h3>
    <input type="checkbox" id="agreement" v-model="isAgree">
    <label for="agreement">{{isAgree}}</label>
    <h3>多复选框</h3>
    <input id="check1" type="checkbox" value="篮球" v-model="interests"> <label for="check1">篮球</label>
    <input id="check2" type="checkbox" value="足球" v-model="interests"> <label for="check2">足球</label>
    <input id="check3" type="checkbox" value="排球" v-model="interests"> <label for="check3">排球</label>
    <input id="check4" type="checkbox" value="游泳" v-model="interests"> <label for="check4">游泳</label>
    <p>你的兴趣爱好是：{{interests}}</p>

    <h3>多复选框1</h3>
    <input id="check11" type="checkbox" :value="interestsobj[0]" v-model="interests2"> <label for="check11">篮球</label>
    <input id="check21" type="checkbox" :value="interestsobj[1]" v-model="interests2"> <label for="check21">足球</label>
    <input id="check31" type="checkbox" :value="interestsobj[2]" v-model="interests2"> <label for="check31">排球</label>
    <input id="check41" type="checkbox" :value="interestsobj[3]" v-model="interests2"> <label for="check41">游泳</label>
    <p>你的兴趣爱好是：{{interests2}}</p>
</div>

<script src="js/vue.global.js"></script>
<script>
    var vm = Vue.createApp({
        data() {
            return {
                isAgree: false,
                interests:["排球"],
                interests2:[],
                interestsobj:[{id:1,name:"排球"},{id:2,name:"足球"},{id:3,name:"排球"},{id:4,name:"游泳"}]
            }
        }
    }).mount("#app");
</script>

</body>
</html>